using System.Web.UI;
using System.Web.UI.HtmlControls;

namespace FluentTags
{

    public class EMTag : Tag<EMTag>
    {
        public EMTag() : base("em"){}
        
        public EMTag(string text) : this()
        {
            Controls.Add(new LiteralControl(text));
        }

        public EMTag(object value) : this()
        {
            Controls.Add(new LiteralControl(SafeString(value)));
        }
        
        
        public EMTag(Control control) : this()
        {
            Controls.Add(control);
        }
        
        
        
        
        public ATag<EMTag> A()
        {
            var ctrl = new ATag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<EMTag> A(string text)
        {
            var ctrl = new ATag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<EMTag> A(Control control)
        {
            var ctrl = new ATag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<EMTag> A(object value)
        {
            return A(SafeString(value));
        }
        
        public BTag<EMTag> B()
        {
            var ctrl = new BTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<EMTag> B(string text)
        {
            var ctrl = new BTag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<EMTag> B(Control control)
        {
            var ctrl = new BTag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<EMTag> B(object value)
        {
            return B(SafeString(value));
        }
        
        public BRTag<EMTag> BR()
        {
            var ctrl = new BRTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<EMTag> EM()
        {
            var ctrl = new EMTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<EMTag> EM(string text)
        {
            var ctrl = new EMTag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<EMTag> EM(Control control)
        {
            var ctrl = new EMTag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<EMTag> EM(object value)
        {
            return EM(SafeString(value));
        }
        
        public ITag<EMTag> I()
        {
            var ctrl = new ITag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<EMTag> I(string text)
        {
            var ctrl = new ITag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<EMTag> I(Control control)
        {
            var ctrl = new ITag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<EMTag> I(object value)
        {
            return I(SafeString(value));
        }
        
        public ImgTag<EMTag> Img()
        {
            var ctrl = new ImgTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<EMTag> Span()
        {
            var ctrl = new SpanTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<EMTag> Span(string text)
        {
            var ctrl = new SpanTag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<EMTag> Span(Control control)
        {
            var ctrl = new SpanTag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<EMTag> Span(object value)
        {
            return Span(SafeString(value));
        }
        
        public StrongTag<EMTag> Strong()
        {
            var ctrl = new StrongTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<EMTag> Strong(string text)
        {
            var ctrl = new StrongTag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<EMTag> Strong(Control control)
        {
            var ctrl = new StrongTag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<EMTag> Strong(object value)
        {
            return Strong(SafeString(value));
        }
        
        public SubTag<EMTag> Sub()
        {
            var ctrl = new SubTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<EMTag> Sub(string text)
        {
            var ctrl = new SubTag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<EMTag> Sub(Control control)
        {
            var ctrl = new SubTag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<EMTag> Sub(object value)
        {
            return Sub(SafeString(value));
        }
        
        public SupTag<EMTag> Sup()
        {
            var ctrl = new SupTag<EMTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<EMTag> Sup(string text)
        {
            var ctrl = new SupTag<EMTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<EMTag> Sup(Control control)
        {
            var ctrl = new SupTag<EMTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<EMTag> Sup(object value)
        {
            return Sup(SafeString(value));
        }
        
        
        public EMTag Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }

        public EMTag Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
    }

    public class EMTag<ParentType> : ChildTag<EMTag<ParentType>, ParentType>
        where ParentType : HtmlGenericControl
    {
        public EMTag(ParentType parent) : base("em", parent) { }

        
        
        
        public ATag<EMTag<ParentType>> A()
        {
            var ctrl = new ATag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<EMTag<ParentType>> A(string text)
        {
            var ctrl = new ATag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<EMTag<ParentType>> A(Control control)
        {
            var ctrl = new ATag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<EMTag<ParentType>> A(object value)
        {
            var ctrl = new ATag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BTag<EMTag<ParentType>> B()
        {
            var ctrl = new BTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<EMTag<ParentType>> B(string text)
        {
            var ctrl = new BTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<EMTag<ParentType>> B(Control control)
        {
            var ctrl = new BTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<EMTag<ParentType>> B(object value)
        {
            var ctrl = new BTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BRTag<EMTag<ParentType>> BR()
        {
            var ctrl = new BRTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<EMTag<ParentType>> EM()
        {
            var ctrl = new EMTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<EMTag<ParentType>> EM(string text)
        {
            var ctrl = new EMTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<EMTag<ParentType>> EM(Control control)
        {
            var ctrl = new EMTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<EMTag<ParentType>> EM(object value)
        {
            var ctrl = new EMTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public ITag<EMTag<ParentType>> I()
        {
            var ctrl = new ITag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<EMTag<ParentType>> I(string text)
        {
            var ctrl = new ITag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<EMTag<ParentType>> I(Control control)
        {
            var ctrl = new ITag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<EMTag<ParentType>> I(object value)
        {
            var ctrl = new ITag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public ImgTag<EMTag<ParentType>> Img()
        {
            var ctrl = new ImgTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<EMTag<ParentType>> Span()
        {
            var ctrl = new SpanTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<EMTag<ParentType>> Span(string text)
        {
            var ctrl = new SpanTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<EMTag<ParentType>> Span(Control control)
        {
            var ctrl = new SpanTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<EMTag<ParentType>> Span(object value)
        {
            var ctrl = new SpanTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public StrongTag<EMTag<ParentType>> Strong()
        {
            var ctrl = new StrongTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<EMTag<ParentType>> Strong(string text)
        {
            var ctrl = new StrongTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<EMTag<ParentType>> Strong(Control control)
        {
            var ctrl = new StrongTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<EMTag<ParentType>> Strong(object value)
        {
            var ctrl = new StrongTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SubTag<EMTag<ParentType>> Sub()
        {
            var ctrl = new SubTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<EMTag<ParentType>> Sub(string text)
        {
            var ctrl = new SubTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<EMTag<ParentType>> Sub(Control control)
        {
            var ctrl = new SubTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<EMTag<ParentType>> Sub(object value)
        {
            var ctrl = new SubTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SupTag<EMTag<ParentType>> Sup()
        {
            var ctrl = new SupTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public EMTag<ParentType> Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<EMTag<ParentType>> Sup(string text)
        {
            var ctrl = new SupTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<EMTag<ParentType>> Sup(Control control)
        {
            var ctrl = new SupTag<EMTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<EMTag<ParentType>> Sup(object value)
        {
            var ctrl = new SupTag<EMTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        
        public EMTag<ParentType> Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }
        
        public EMTag<ParentType> Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
        
    }
}